package name.jiaosha.air.company.domain;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import name.jiaosha.air.constant.Sex;

import com.ali8ba.Domain;

/*@Entity
@Table(name = "employee")
@ObjectTypeConverter(name = "sex", objectType = Sex.class, dataType = String.class, conversionValues = {
		@ConversionValue(objectValue = "Male", dataValue = "M"),
		@ConversionValue(objectValue = "Female", dataValue = "F") })*/
public class Employee extends Domain {

	private static final long serialVersionUID = 1L;
	
	private Integer id;
	
	private Integer areaId;
	/**
	 * 身份证
	 */
	private String idcard;

	private String age;
	/**
	 * 是否在职,Y在职;N已离职
	 */
	private String inJob;
	/**
	 * 进入公司日期
	 */
	private Date intime;
	/**
	 * 离职日期
	 */
	private Date leavetime;
	/**
	 * 姓名
	 */
	private String name;
	/**
	 * 姓名简拼
	 */
	private String namePinyin;
	/**
	 * 联系电话
	 */
	private String phone;
	/**
	 * 性别 M男;W女
	 */
	private Sex sex;

	private Integer comId;

	private Integer departmentId;

	

	/**
	 * 工号
	 */
	@Transient
	private String empID;
	/**
	 * 提成 88.99 等这样的数据 0-100的双精度数字
	 */
	@Transient
	private BigDecimal percentage;
	/**
	 * 职位 师傅;徒弟等
	 */
	@Transient
	private String position;
	/**
	 * 紧急情况联系人
	 */
	@Transient
	private String emergencyMan;
	/**
	 * 紧急情况联系人电话
	 */
	@Transient
	private String emergencyCall;

	public Employee() {
	}

	public String getEmpID() {
		return empID;
	}

	public void setEmpID(String empID) {
		this.empID = empID;
	}

	@Id()
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false, precision = 11)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Basic()
	@Column(name = "area_id", precision = 11)
	public Integer getAreaId() {
		return this.areaId;
	}

	public void setAreaId(Integer areaId) {
		this.areaId = areaId;
	}

	@Basic()
	@Column(name = "idcard", length = 18)
	public String getIdcard() {
		return this.idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	@Basic()
	@Column(name = "in_job", length = 2)
	public String getInJob() {
		return this.inJob;
	}

	public void setInJob(String inJob) {
		this.inJob = inJob;
	}

	@Basic()
	@Column(name = "intime", length = 10)
	@Temporal(TemporalType.DATE)
	public Date getIntime() {
		return this.intime;
	}

	public void setIntime(Date intime) {
		this.intime = intime;
	}

	@Basic()
	@Column(name = "leavetime", length = 10)
	@Temporal(TemporalType.DATE)
	public Date getLeavetime() {
		return this.leavetime;
	}

	public void setLeavetime(Date leavetime) {
		this.leavetime = leavetime;
	}

	@Basic()
	@Column(name = "name", length = 10)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Basic()
	@Column(name = "name_pinyin", length = 30)
	public String getNamePinyin() {
		return this.namePinyin;
	}

	public void setNamePinyin(String namePinyin) {
		this.namePinyin = namePinyin;
	}

	@Basic()
	@Column(name = "phone", length = 20)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Basic()
	//@Convert("sex")
	@Column(name = "sex")
	public Sex getSex() {
		return sex;
	}

	public void setSex(Sex sex) {
		this.sex = sex;
	}

	public String getEmergencyMan() {
		return emergencyMan;
	}

	public void setEmergencyMan(String emergencyMan) {
		this.emergencyMan = emergencyMan;
	}

	public String getEmergencyCall() {
		return emergencyCall;
	}

	public void setEmergencyCall(String emergencyCall) {
		this.emergencyCall = emergencyCall;
	}

	public BigDecimal getPercentage() {
		return percentage;
	}

	public void setPercentage(BigDecimal percentage) {
		this.percentage = percentage;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}
	
	public Integer getComId() {
		return comId;
	}

	public void setComId(Integer comId) {
		this.comId = comId;
	}

	public Integer getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(Integer departmentId) {
		this.departmentId = departmentId;
	}

}